﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.IO;

namespace Cjc.Data.Mapping
{
	public class MappingContextAttribute : Attribute
	{
		public Type MappingContextInfoType { get; set; }

		public MappingContextAttribute( Type mappingContextInfoType )
		{
			this.MappingContextInfoType = mappingContextInfoType;
		}
	}

	public interface IMappingContextInfo
	{
		ExpressionTranslator CreateExpressionTranslator();
		object CreateContext( object settings, TextWriter log );
		IQueryProvider GetQueryProvider( object context );
		void SubmitChanges( object context );
		bool MustInlineInvokes { get; }
		Type GetEntityType( string typeName );
		Type GetEntityAssociationType( string typeName );
		LambdaExpression GetEntitiesMethod( Type type );
		LambdaExpression GetXmlMethod( TypeCode typeCode );
		LambdaExpression GetLookupMethod( TypeCode typeCode );
	}

	public interface IMappingContextInfo<TContext> : IMappingContextInfo
	{
	}
}